﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ImageHandler
{
    /// <summary>
    /// Interaction logic for ColorPickerWindow.xaml
    /// </summary>
    public partial class ColorPickerWindow : Window
    {
        public SolidColorBrush SelectedBrush { get; set; }
        public ColorPickerWindow()
        {
            InitializeComponent();
        }

        public ColorPickerWindow(SolidColorBrush colorBrush)
        {
            InitializeComponent();
            Picker.SelectedBrush = colorBrush;
        }

        private void Picker_Confirmed(object sender, HandyControl.Data.FunctionEventArgs<Color> e)
        {
            DialogResult = true;
            SelectedBrush = Picker.SelectedBrush;
            this.Close();
        }

        private void Picker_Canceled(object sender, EventArgs e)
        {
            DialogResult = false;
            this.Close();
        }
    }
}
